<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./style.css">
  <!-- <script src="./index.js"></script> -->
  <script src="./index1.js"></script>

</head>

<body>
  <script>
    // var str ='asfjja';

    // console.log(n1);

    var obj = {
      a: '123',
      b: '45',
      c: {
        d: '6',
        e: '7'
      }
    }
    console.log(obj)
    console.log(obj.b)
    console.log(obj.c.e)
    var arr = [1, 2, 3, 4]
    console.log(arr[0], arr.length);
    function add(x, y) {
      // console.log('计算结果',x+y)
      return x + y;
    }
    // add(1,2)
    var data = add(2, 3)
    console.log(data);
    var maxNum = Math.max(12, 34, 56, 78);
    console.log(maxNum);
    var str = 'hello world';
    console.log(str.length);
    var str2 = str.replace('world', 'zkq');
    console.log(str2);
    var str3 = str2.toUpperCase();
    console.log(str3);
    var zhang = {
      name: 'zhangkaiqi',
      age: 1995,
      sex: 'nan',
      friend: ['小明', '小张', '小甘']
    }
    console.log('性别', zhang.sex)
    console.log('年龄', (zhang.age + "").charAt(2))
    console.log(zhang.friend[2])
    // var arr3= new Array();
    // arr3[0]='hello';
    // arr3[1]='world';
    // console.log(arr3)
    var arr2 = ['hello', 'world'];
    console.log(arr2);
    arr2.push('nice');
    console.log(arr2);
    arr2.pop();
    console.log(arr2);
    arr2.shift();
    console.log(arr2)
    // var arr3= new Array('a','b')
    // console.log(arr3[0],arr3[1])
    arr2.unshift('hi')
    console.log(arr2)
  </script>
</body>

</html>